<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/news_bulletin/newsBulletin/save}">
        <input type="hidden" name="id" th:if="${newsBulletin}" th:value="${newsBulletin.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">新闻标题</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="news_headlines" placeholder="请输入新闻标题" th:value="${newsBulletin?.news_headlines}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新闻内容</label>
            <div class="layui-input-inline" style="width: 80%">
                <textarea name="news_content" rows="12" cols="120" id="news_content" class="xheditor" th:value="${newsBulletin?.news_content}" placeholder="请输入新闻内容"> </textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新闻分类</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="news_classification" placeholder="请输入新闻分类" th:value="${newsBulletin?.news_classification}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发布人</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="news_release_person" placeholder="请输入发布人" th:value="${newsBulletin?.news_release_person}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${newsBulletin?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script">
</script>
    <script type="text/javascript">
        layui.use('layedit', function(){
            var layedit = layui.layedit;
            layedit.build('news_content');   //建立编辑器
            layedit.set({
                //暴露layupload参数设置接口 --详细查看layupload参数说明
                uploadImage: {
                    url: ''    //上传接口url
                    ,type: 'post' //默认post
                }
                , devmode: true
                //插入代码设置
                , codeConfig: {
                    hide: true,  //是否显示编码语言选择框
                    default: 'javascript' //hide为true时的默认语言格式
                }
                , tool: [
                    'html', 'code', 'strong',  'underline', 'del', 'addhr', '|', 'fontFomatt', 'colorpicker', 'face'
                    , '|', 'left', 'center', 'right', '|', 'link', 'unlink','images', 'image_alt',
                    , '|', 'fullScreen'
                ]
                ,height: 500, //设置编辑器高度
            });
        });
    </script>
</body>
</html>